﻿
@{
    ViewBag.Title = "FireOperateFormAdd";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}

@section css{
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <style>
        #location {
            position: absolute;
            z-index: 100;
            width: 10px;
            height: 10px;
            color: red;
            font-weight: bold;
        }

        .div-relative {
            position: relative;
        }

        .div-a {
            position: absolute;
        }
    </style>
}

<header id="topbar">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a>高处作业申请</a>
            </li>
            <li class="crumb-link">
                <a>高处作业</a>
            </li>
            <li class="crumb-link">
                <a>施工作业</a>
            </li>
            <li class="crumb-trail">高处作业申请</li>
        </ol>
    </div>
</header>
<div id="content" ng-cloak ng-controller="ConstructionController" ng-init="
     page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
     Id='@(Request.QueryString["Id"].IsEmpty() ? "" : Request.QueryString["Id"])';
     GetConstructionCompany('Company_Select');
     GetClimbOperateEqu();
     GetClimbOperateSafetySolution();
     GetClimbOperateDetailForm(Id);
     GetConstructionFileList(Id);
          GetApproveLogList(Id);
     ">
    <div class="load" id="div_load">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />
			</path>
		</svg>
            <div class="load-msg">正在加载</div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-info panel-border top mb35">
                <div class="panel-heading">
                    <span class="panel-title">高处作业申请</span>
                </div>
                <div class="panel-body">
                    <form class="form-horizontal" role="form">

                        <div class="form-group">
                            <label class="col-sm-1 control-label"><b style="color:red;">*</b>施工单号</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" value="{{DetailModel.ConstructionInfo}}" disabled>
                            </div>
                            <label class="col-sm-1 control-label"><b style="color:red;">*</b>所在厂区</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" value="{{DetailModel.FactoryAreaName}}" disabled>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label"><b style="color:red;">*</b>申请部门</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" value="{{DetailModel.DepartmentName}}" disabled>
                            </div>
                            <label class="col-sm-1 control-label"><b style="color:red;">*</b>申请人</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" value="{{DetailModel.CreateUserName}}" disabled>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label"><b style="color:red;">*</b>项目名称</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" value="{{DetailModel.ProjectName}}" disabled>
                            </div>
                            <label class="col-sm-1 control-label"></label>
                            <div class="col-lg-2">
                                <label class="radio-inline">
                                    <input type="checkbox" id="IsOutdoor_1" name="IsOutDoor">室内
                                </label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <label class="radio-inline">
                                    <input type="checkbox" id="IsOutdoor_2" name="IsOutDoor">室外
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label"><b style="color:red;">*</b>申请日期</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" value="{{DetailModel.ApplyDate|JSONDate:'yyyy-MM-dd'}}" disabled>
                            </div>
                            <label class="col-lg-1 control-label"><b style="color:red;">*</b>作业单位</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" value="{{DetailModel.CompanyName}}" disabled>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-1 control-label"><b style="color:red;">*</b>作业内容</label>
                            <div class="col-lg-9">
                                <textarea class="form-control" rows="3" disabled>{{DetailModel.Content}}</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-1 control-label">作业地点</label>
                            <div class="col-lg-9">
                                <input type="text" class="form-control" value="{{DetailModel.FormLocationContent}}" disabled>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-lg-1 control-label"><b style="color:red;">*</b>作业人员</label>
                            <div class="col-lg-9">
                                <select id="Worker_Select" class="selectpicker show-tick form-control" data-live-search="true" multiple disabled>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-1 control-label"><b style="color:red;">*</b>施工单位现场<br />作业监护人</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" placeholder="施工单位现场作业监护人..." ng-model="DetailModel.Responsible">
                            </div>
                            <label class="col-lg-1 control-label"><b style="color:red;">*</b>联系方式</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" placeholder="施工单位现场负责人联系方式..." ng-model="DetailModel.Phone">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-1 control-label"><b style="color:red;">*</b>申请部门现场<br />监护人</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" placeholder="申请部门现场监护人..." ng-model="DetailModel.ApplyDepContact">
                            </div>
                            <label class="col-lg-1 control-label"><b style="color:red;">*</b>联系方式</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" placeholder="申请部门现场监护人联系方式..." ng-model="DetailModel.ApplyDepPhone">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-1 control-label"><b style="color:red;">*</b>属地部门联系人</label>
                            <div class="col-lg-2">
                                <input type="text" class="form-control" placeholder="属地部门" ng-model="DetailModel.LocalDepName">
                            </div>
                            <div class="col-lg-2">
                                <input type="text" class="form-control" placeholder="属地联系人..." ng-model="DetailModel.LocalDepContact">
                            </div>
                            <label class="col-lg-1 control-label"><b style="color:red;">*</b>联系方式</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" placeholder="属地联系人联系方式..." ng-model="DetailModel.LocalDepPhone">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-1 control-label"><b style="color:red;">*</b>有效期开始时间</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" value="{{DetailModel.ActualStartTime|JSONDate:'yyyy-MM-dd HH:mm'}}" disabled>
                            </div>
                            <label class="col-lg-1 control-label"><b style="color:red;">*</b>有效期结束时间</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" value="{{DetailModel.EndTime|JSONDate:'yyyy-MM-dd HH:mm'}}" disabled>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-1 control-label"><b style="color:red;">*</b>安全设施</label>
                            <div class="col-lg-9" style="padding-left:20px;">
                                <label class="checkbox checkbox-inline" ng-repeat="x in EquList">
                                    <input type="checkbox" id="chk_equ_{{x.Id}}" disabled>{{x.Content}}
                                </label>
                                <input type="text" ng-model="DetailModel.OtherSafetyEqu" style="width:100px;border:none;border-bottom:1px solid grey;" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-1 control-label"><b style="color:red;">*</b>安全措施</label>
                            <div class="col-lg-9" style="padding-left:20px;">
                                <label class="checkbox" ng-repeat="x in SolutionList">
                                    <input type="checkbox" id="chk_solution_{{x.Id}}" disabled>{{x.Content}}
                                </label>
                                <input type="text" ng-model="DetailModel.OtherSafetySolution" style="width:100px;border:none;border-bottom:1px solid grey;" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-1 control-label">已上传附件</label>
                            <div class="col-lg-9">
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <th style="width:5%">序号</th>
                                            <th style="width:30%">文件名称</th>
                                            <th style="width:10%">文件大小(kb)</th>
                                            <th style="width:10%">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr ng-show="FileList.length==0">
                                            <td colspan="4" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                                        </tr>
                                        <tr ng-repeat="x in FileList">
                                            <td ng-bind="$index+1"></td>
                                            <td ng-bind="x.FileName"></td>
                                            <td ng-bind="x.FileSize"></td>
                                            <td>
                                                <a href="../Download/DownloadFile?FileId={{x.FileId}}" class="btn btn-success btn-xs btn-label"><i class="fa fa-download"></i>下载</a>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-1 control-label">审核/审批记录</label>
                            <div class="col-lg-9">
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>操作人</th>
                                            <th>操作时间</th>
                                            <th>操作类型</th>
                                            <th>意见</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr ng-show="ApproveLog.length==0">
                                            <td colspan="5" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                                        </tr>
                                        <tr ng-repeat="x in ApproveLog">
                                            <td ng-bind="$index+1"></td>
                                            <td ng-bind="x.ApproveUserName"></td>
                                            <td>{{x.ApproveTime|JSONDate:'yyyy-MM-dd HH:mm'}}</td>
                                            <td ng-bind="x.OperateName"></td>
                                            <td><span ng-if="x.IsApprove">通过</span><span ng-if="!x.IsApprove">驳回</span>-{{x.Remark}}</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="panel-footer">
                    <div class="row">
                        <div class="col-lg-1"></div>
                        <div class="col-lg-1">
                            <button type="button" class="btn btn-primary" onclick="printDiv('printpage');">打印</button>
                        </div>
                        <div class="col-lg-1">   <a href="ClimbOperateFormPageList?page={{page}}" class="btn btn-warning">返回</a></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="AddModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:985px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">添加施工单位</h2>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" role="form">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">施工单位名称</label>
                            <div class="col-lg-5">
                                <input type="text" class="form-control" placeholder="施工单位名称" ng-model="AddCompany.CompanyName">
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="btn_close">关闭</button>
                    <button type="button" class="btn btn-primary" ng-click="AddConstructionCompany(AddCompany);">提交</button>
                </div>
            </div>
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

    <div class="modal fade" id="MapModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:985px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">厂区地图</h2>
                </div>
                <div class="modal-body">
                    <div class="div-relative" id="mapContent">
                        <div id="location" style="left:50%;top:50%;">
                            <i class="fa fa-map-marker"></i>
                        </div>
                        <img src="~/Bussiness/img/pvgmap.jpg" width="950" ng-show="AddModel.FactoryAreaId=='1'" />
                        <img src="~/Bussiness/img/dcArea.jpg" width="950" ng-show="AddModel.FactoryAreaId=='2'" />
                        <div ng-repeat="location in LocationList">
                            <div class="div-a" ng-style="{'left':location.X+'%','top':location.Y+'%'}">
                                <div style="font-size:12px; border-radius:4px;cursor:pointer;">
                                    <a class="titlediv" style="color:gainsboro;" title="{{location.BuildingName}}">{{location.SimpleName}}</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <input type="hidden" id="h_XAxis" value="0" />
                    <input type="hidden" id="h_YAxis" value="0" />
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="SelectPosition(CurrentLocationModel)">确定</button>
                </div>
            </div>
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->


    <div class="modal fade" id="NoticeModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:985px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">注意事项</h2>
                </div>
                <div class="modal-body" style="height:500px;overflow-y:scroll;">


                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="btn_close2">关闭</button>
                    <button type="button" class="btn btn-primary" ng-click="EditClimbOperateForm(EditModel,1,page);">我已阅读并同意以上事项</button>
                </div>
            </div>
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

    <div id="printpage" class="modal">
        <style>

            .mytable {
                border-top: 1px solid #999;
                border-left: 1px solid #999;
                border-spacing: 0;
                text-align: center;
                line-height: 30px;
                table-layout: fixed;
            }

                .mytable td {
                    border-bottom: 1px solid #999;
                    border-right: 1px solid #999;
                    overflow-wrap: break-word;
                    word-wrap: break-word;
                }
        </style>
        <form class="form-horizontal" role="form">
            <h2 style="text-align:center;">高处作业审批表</h2>
            <h5 style="margin-top: 40px;">高处作业单号：{{DetailModel.FormNo}}</h5>
            <table class="mytable" style="width:980px;">
                <tr>
                    <td>项目名称</td>
                    <td colspan="4">
                        {{DetailModel.ProjectName}}
                    </td>
                </tr>
                <tr>
                    <td style="width:196px">申请部门</td>
                    <td style="width:294px">{{DetailModel.DepartmentName}}</td>
                    <td style="width:196px">申请部门现场<br />监护人及电话</td>
                    <td colspan="2" style="width:294px">{{DetailModel.ApplyDepContact}}<br />{{DetailModel.ApplyDepPhone}}</td>
                </tr>
                <tr>
                    <td style="width:196px">作业单位</td>
                    <td style="width:294px">{{DetailModel.CompanyName}}</td>
                    <td style="width:196px">作业人员</td>
                    <td colspan="2" style="width:294px"><p ng-repeat="x in DetailModel.WorkerList">{{x.WorkerName}}-{{x.IdCardNo}}</p></td>
                </tr>
                <tr>
                    <td style="width:196px">作业监护人</td>
                    <td style="width:294px">{{DetailModel.Responsible}}</td>
                    <td style="width:196px">联系电话</td>
                    <td style="width:294px">{{DetailModel.Phone}}</td>
                    <td>
                        <label class="radio-inline">
                            <input type="checkbox" id="IsOutdoor2_1" name="IsOutDoor">室内
                        </label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <label class="radio-inline">
                            <input type="checkbox" id="IsOutdoor2_2" name="IsOutDoor">室外
                        </label>
                    </td>

                </tr>
                <tr>
                    <td>作业内容和地点</td>
                    <td colspan="4" style="text-align:left;">
                        {{DetailModel.Content}}<br />
                        {{DetailModel.FactoryAreaName}} {{DetailModel.FormLocationContent}}
                    </td>
                </tr>
                <tr>
                    <td>作业时间</td>
                    <td colspan="4" style="text-align:left;">
                        {{DetailModel.ActualStartTime|JSONDate:'yyyy年MM月dd日HH时mm分'}}   至   {{DetailModel.EndTime|JSONDate:'yyyy年MM月dd日HH时mm分'}}
                    </td>
                </tr>
                <tr>
                    <td>安全设施</td>
                    <td colspan="4" style="text-align:left;">
                        <label class="checkbox-inline" ng-repeat="x in EquList">
                            <input type="checkbox" id="chk_equ2_{{x.Id}}" name="IsPublic"> {{x.Content}}
                        </label>
                        <input type="text" disabled value="{{DetailModel.OtherSafetyEqu}}" style="width:50px;border:none;border-bottom:1px solid grey;" />
                    </td>
                </tr>
                <tr>
                    <td>安全措施</td>
                    <td colspan="4">
                        <div class="col-lg-9" style="text-align:left;">
                            <label class="checkbox" ng-repeat="x in SolutionList">
                                <input type="checkbox" id="chk_solution2_{{x.Id}}" name="IsPublic">{{x.Content}}<br />
                            </label>
                            <input type="text" value="{{DetailModel.OtherSafetySolution}}" style="width:100px;border:none;border-bottom:1px solid grey;" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>施工区域属地联系人</td>
                    <td>{{DetailModel.LocalDepContact}}</td>
                    <td>联系方式</td>
                    <td colspan="2">{{DetailModel.LocalDepPhone}}</td>
                </tr>
                <tr ng-repeat="y in ApproveLog">
                    <td>安环部{{y.OperateName}}及意见</td>
                    <td colspan="4">
                        {{y.ApproveUserName}}<br />
                        <span ng-if="y.IsApprove">同意</span><span ng-if="!y.IsApprove">驳回</span> {{y.Remark}}<br />
                        {{y.ApproveTime|JSONDate:'yyyy-MM-dd HH:mm'}}
                    </td>
                </tr>

            </table>
        </form>
    </div>
</div>

@section Js{
    <script src="~/Bussiness/js/libs/upload.js"></script>
    <script src="~/Bussiness/js/pg/Construction.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
    <script src="~/Bussiness/js/libs/moment.min.js"></script>
    <script src="~/Bussiness/js/libs/locales/date/zh-cn.js"></script>
    <script src="~/Bussiness/js/libs/bootstrap-datetimepicker.min.js"></script>
    <script src="~/Bussiness/js/libs/angularjs-datepicker.js"></script>
    <script src="~/Bussiness/js/libs/fileinput.js"></script>
    <script src="~/Bussiness/js/libs/zh.js"></script>
    <script>


        function printDiv(divId) {
            var printContents = document.getElementById(divId).innerHTML;
            var pc = document.getElementById("div_print");
            var pw = window.open('', '', 'width=900,height=700');
            pw.document.write('<html>');
            pw.document.write('<head>');
            pw.document.write('<title>临时动火作业审批表</title>');
            pw.document.write('</head>');
            pw.document.write('<body>');
            pw.document.write(printContents);
            pw.document.write('</body>');
            pw.document.write('</html>');
            pw.document.close();
            pw.print();
            //var originalContents = document.body.innerHTML;
            //document.body.innerHTML = printContents;
            //document.body.style.height ="auto";
            //window.print();
            //document.body.innerHTML = originalContents;
        }

        load();
        function load() {
            $("#div_load").show();
            setTimeout(function () {
                $("#div_load").hide();
            }, 5000);
        }
    </script>
}